function initUserEditForm(id, firstname, lastname, address, title) {
	$("#edit_userid").val(id);
	$("#edit_firstname").val(firstname);
	$("#edit_lastname").val(lastname);
	$("#edit_address").val(address);
	$("#headTitle").html(title);
}

function initSelects_inner(){
	var selects = $("select");
	selects.attr('class', 'selectpicker show-menu-arrow');
	selects.attr('data-container', 'body');
	selects.attr('data-size', '10');
	selects.selectpicker();
}

function initSelects(callback) {
	if (lazySelectInit) {
		showLoadingModal(function() {
			initSelects_inner();
		}, callback);
	} else {
		initSelects_inner();
	}
}

var lazySelectInit = false;

$(document).ready(function() {
	// Init method on pages - if exists
	if (typeof pageInit != 'undefined' && jQuery.isFunction(pageInit)) {
		pageInit();
	}

	// Init number inputs
	$('input[type|="number"]').keypress(function(event) {
		return isNumber(event);
	});

	// Selects
	if (lazySelectInit == false) {
		initSelects();
	}

	// UserInfo DIV
	if ($("#json") != undefined && $("#json") != null && $("#json").text() != "") {
		var info = jQuery.parseJSON($("#json").text());
		var newDate = new Date();
		$.each(info, function(key, value) {
			var content = '<div class="alert fade in alert-' + this.infotype + '">';
			content += '<button type="button" class="close" data-dismiss="alert">&times;</button>';
			content += '<div>';
			content += '<strong>' + newDate.timeNow() + ': </strong>';
			if (this.msg != null) {
				content += this.msg;
			} else {
				content += 'Nem megfelelő bevitel! [' + this.value + ']';
			}
			content += '</div>';

			$('#' + this.name).closest('.control-group').addClass(this.infotype);

			$("#userinfo").append(content);
		});
	}
});